# Contributor: Fabian Affolter <fabian@affolter-engineering.ch>
# Maintainer: Fabian Affolter <fabian@affolter-engineering.ch>
pkgname=py3-dpath
_pkgname=dpath
pkgver=2.2.0
pkgrel=0
pkgdesc="Filesystem-like pathing and searching for dictionaries"
url="https://github.com/dpath-maintainers/dpath-python"
arch="noarch"
license="MIT"
depends="python3"
makedepends="py3-setuptools py3-gpep517"
checkdepends="py3-hypothesis py3-mock py3-nose2 py3-pytest"
subpackages="$pkgname-pyc"
source="https://files.pythonhosted.org/packages/source/${_pkgname:0:1}/$_pkgname/$_pkgname-$pkgver.tar.gz"
builddir="$srcdir/$_pkgname-$pkgver"

replaces="py-dpath" # for backwards compatibility
provides="py-dpath=$pkgver-r$pkgrel" # for backwards compatibility

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages .testenv
	gpep517 install-wheel --destdir .testenv --prefix '' .dist/*.whl
	.testenv/bin/python3 -m pytest
}

package() {
	gpep517 install-wheel --destdir "$pkgdir" \
		.dist/*.whl
}

sha512sums="
d7ab814299580fb54bd2436bb437ae6af6ad1c9057ba4dda708d023f1e49658d41f33260b66348c1d03ff598543f5d68fc759d462ed709ec7da534780e37603c  dpath-2.2.0.tar.gz
"
